package com.github.shiqiyue.app.modules.sys.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.shiqiyue.app.modules.sys.entity.OperLog;
import com.github.shiqiyue.app.modules.sys.enums.OperlogTypeEnum;
import com.github.shiqiyue.app.modules.sys.mapper.OperLogMapper;
import com.github.shiqiyue.app.modules.sys.service.IOperLogService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 操作日志 服务实现类
 * </p>
 *
 * @author wenyao.wu
 * @since 2020-06-19
 */
@Service
public class OperLogServiceImpl extends ServiceImpl<OperLogMapper, OperLog> implements IOperLogService {

    @Override
    public void addLog(Long userId, OperlogTypeEnum operlogTypeEnum, String content, Long targetId) {
        OperLog operLog = new OperLog();
        operLog.setUserId(userId);
        operLog.setType(operlogTypeEnum);
        operLog.setContent(content);
        operLog.setTargetId(targetId);
        this.save(operLog);

    }
}
